numbers=[]
while True:
    num=int(input())
    if mun==0:
        break
numbers.append(num)
max_num=max(numbers)
print(max_num)
print(numbers.count(max_num))